package com.zhny.aiot.water.monitor.plugin;

import com.zhny.aiot.plugin.ICenterFacilities;
import com.zhny.aiot.plugin.IDevice;
import com.zhny.aiot.plugin.model.DeviceEntity;
import com.zhny.aiot.plugin.model.FactoryType;
import com.zhny.aiot.plugin.model.StoreEntity;
import com.zhny.aiot.plugin.udc.UdcServer;
import com.zhny.aiot.plugin.udc.device.UdcDeviceFactory;
import com.zhny.aiot.water.monitor.plugin.config.WaterMonitorConfig;
import com.zhny.aiot.water.monitor.plugin.model.WaterMonitorStoreEntry;
import org.pf4j.Extension;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;

public class WaterMonitorPlugin extends Plugin {
    public WaterMonitorPlugin(PluginWrapper wrapper) {
        super (wrapper);
    }
    @Extension
    public static class WaterMonitorFactory extends UdcDeviceFactory<WaterMonitorConfig> {
        @Override
        public Class<WaterMonitorConfig> configClass() {
            return WaterMonitorConfig.class;
        }

        public IDevice createDevice(ICenterFacilities iCenterFacilities, DeviceEntity entity) {
            return new WaterMonitorDevice(UdcServer.getInstance ().getEngine () ,this,iCenterFacilities,entity);
        }

        public Class<? extends StoreEntity> storeClass() {
            return WaterMonitorStoreEntry.class;
        }

        public String getId() {
            return "zhny-udc-xmn-water-monitor-plugin";
        }

        public String getName() {
            return "希马诺水资源监测设备插件";
        }

        public FactoryType getType() {
            return FactoryType.Integrate;
        }


    }
}
